package com.ayz.gateway.sdk.app.config;

import cn.hutool.core.util.StrUtil;
import lombok.Data;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName AppSdkClientConfig
 * @Description TODO: SDK客户端的配置参数
 * @Author 快乐的星球
 * @Date 2023/5/23 15:41
 * @Version 1.0
 **/
@Data
public class AppSdkClientConfig {
    /**
     * AppSdkClient默认每隔10S钟定时任务去向网关注册中心上报一次服务列表
     */
    private long registryApplicationTaskTime= TimeUnit.SECONDS.toMillis(5);
    /**
     * 应用程序的名称
     */
    private String applicationName;
    /**
     * 业务组的名称
     */
    private String gatewayGroup;


    public AppSdkClientConfig(String applicationName, String gatewayGroup) {
        if(StrUtil.isBlank(applicationName) || StrUtil.isBlank(gatewayGroup)){
            throw new IllegalArgumentException("application name and gateway group must not be null!");
        }
        this.applicationName = applicationName;
        this.gatewayGroup = gatewayGroup;
    }

}
